package egy.rev;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class datesActivity extends ListActivity {
	
	
	private static String [] dates = new String[] 
	{
		"25th Jan 2011", "26th Jan 2011", "27th Jan 2011",
		"28th Jan 2011", "29th Jan 2011", "30th Jan 2011",
		"31st Jan 2011", " 1st Feb 2011", " 2nd Feb 2011",
		" 3rd Feb 2011", " 4th Feb 2011", " 5th Feb 2011",
		" 6th Feb 2011", " 7th Feb 2011", " 8th Feb 2011",
		" 9th Feb 2011", "10th Feb 2011", "11st Feb 2011"
	};
	
	
	private ArrayAdapter<String> listAdapter;
	
	
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
        setContentView(R.layout.dateslayout);
        
        
        listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1 , dates);

        setListAdapter(listAdapter);
        
        ListView lv = getListView();
        
        lv.setOnItemClickListener(new OnItemClickListener() {
        	
        	 @Override
        	 public void onItemClick(AdapterView<?> parent, View view,
        		        int position, long id) {
        		      // When clicked, show a toast with the TextView text
        		      /*Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
        		          Toast.LENGTH_SHORT).show();*/
        		 
        		 	 	switch((int)id)
        		 	 	{
        		 	 		case 0:
        		 	 			
        						Intent myint = new Intent(view.getContext(),images.class);
        						startActivity(myint);				        		 	 			
        		 	 			break;
        		 	 		
        		 	 		case 1:
        		 	 			break;
        		 	 		default:
        		 	 	}
        		 
        	
        	 	}

			
        
        
	});
	
	


}

}
